/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author Mr-Quick
 */
@Entity
@Table(name = "House")
@NamedQueries({
    @NamedQuery(name = "House.findAll", query = "SELECT h FROM House h"),
    @NamedQuery(name = "House.findByIdHouse", query = "SELECT h FROM House h WHERE h.idHouse = :idHouse"),
    @NamedQuery(name = "House.findByTittlehouse", query = "SELECT h FROM House h WHERE h.tittlehouse = :tittlehouse"),
    @NamedQuery(name = "House.findByDateUp", query = "SELECT h FROM House h WHERE h.dateUp = :dateUp"),
    @NamedQuery(name = "House.findBySquarefootageEarth", query = "SELECT h FROM House h WHERE h.squarefootageEarth = :squarefootageEarth"),
    @NamedQuery(name = "House.findBySquarefootageHouse", query = "SELECT h FROM House h WHERE h.squarefootageHouse = :squarefootageHouse"),
    @NamedQuery(name = "House.findByCity", query = "SELECT h FROM House h WHERE h.city = :city"),
    @NamedQuery(name = "House.findByLocation", query = "SELECT h FROM House h WHERE h.location = :location"),
    @NamedQuery(name = "House.findByBedroom", query = "SELECT h FROM House h WHERE h.bedroom = :bedroom"),
    @NamedQuery(name = "House.findByBathroom", query = "SELECT h FROM House h WHERE h.bathroom = :bathroom"),
    @NamedQuery(name = "House.findByLivingroom", query = "SELECT h FROM House h WHERE h.livingroom = :livingroom"),
    @NamedQuery(name = "House.findByTypehouse", query = "SELECT h FROM House h WHERE h.typehouse = :typehouse"),
    @NamedQuery(name = "House.findByHomestyle", query = "SELECT h FROM House h WHERE h.homestyle = :homestyle"),
    @NamedQuery(name = "House.findByDeposit", query = "SELECT h FROM House h WHERE h.deposit = :deposit"),
    @NamedQuery(name = "House.findByIntroduction", query = "SELECT h FROM House h WHERE h.introduction = :introduction"),
    @NamedQuery(name = "House.findByTypepayment", query = "SELECT h FROM House h WHERE h.typepayment = :typepayment"),
    @NamedQuery(name = "House.findByLinkmap", query = "SELECT h FROM House h WHERE h.linkmap = :linkmap"),
    @NamedQuery(name = "House.findByDateExpire", query = "SELECT h FROM House h WHERE h.dateExpire = :dateExpire"),})
public class House implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "IdHouse")
    private String idHouse;
    @Column(name = "tittlehouse")
    private String tittlehouse;
    @Column(name = "DateUp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateUp;
    @Column(name = "SquarefootageEarth")
    private String squarefootageEarth;
    @Column(name = "SquarefootageHouse")
    private String squarefootageHouse;
    @Column(name = "city")
    private String city;
    @Column(name = "location")
    private String location;
    @Column(name = "bedroom")
    private Integer bedroom;
    @Column(name = "bathroom")
    private Integer bathroom;
    @Column(name = "livingroom")
    private Integer livingroom;
    @Column(name = "typehouse")
    private String typehouse;
    @Column(name = "homestyle")
    private String homestyle;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "deposit")
    private Double deposit;
    @Column(name = "introduction")
    private String introduction;
    @Column(name = "typepayment")
    private String typepayment;
    @Column(name = "linkmap")
    private String linkmap;
    @OneToMany(mappedBy = "idHouse")
    private List<Savemessage> savemessageList;
    @OneToMany(mappedBy = "idImage")
    private List<LinkImage> linkImageList;
    @JoinColumn(name = "IDUser", referencedColumnName = "IDUser")
    @ManyToOne
    private SwhUser iDUser;
    
    
    public House() {
    }
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateExpire;
    public House(String idHouse) {
        this.idHouse = idHouse;
    }

    public String getIdHouse() {
        return idHouse;
    }

    public void setIdHouse(String idHouse) {
        this.idHouse = idHouse;
    }

    public String getTittlehouse() {
        return tittlehouse;
    }

    public void setTittlehouse(String tittlehouse) {
        this.tittlehouse = tittlehouse;
    }

    public Date getDateUp() {
        return dateUp;
    }

    public void setDateUp(Date dateUp) {
        this.dateUp = dateUp;
    }

    public String getSquarefootageEarth() {
        return squarefootageEarth;
    }

    public void setSquarefootageEarth(String squarefootageEarth) {
        this.squarefootageEarth = squarefootageEarth;
    }

    public String getSquarefootageHouse() {
        return squarefootageHouse;
    }

    public void setSquarefootageHouse(String squarefootageHouse) {
        this.squarefootageHouse = squarefootageHouse;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public Integer getBedroom() {
        return bedroom;
    }

    public void setBedroom(Integer bedroom) {
        this.bedroom = bedroom;
    }

    public Integer getBathroom() {
        return bathroom;
    }

    public void setBathroom(Integer bathroom) {
        this.bathroom = bathroom;
    }

    public Integer getLivingroom() {
        return livingroom;
    }

    public void setLivingroom(Integer livingroom) {
        this.livingroom = livingroom;
    }

    public String getTypehouse() {
        return typehouse;
    }

    public void setTypehouse(String typehouse) {
        this.typehouse = typehouse;
    }

    public String getHomestyle() {
        return homestyle;
    }

    public void setHomestyle(String homestyle) {
        this.homestyle = homestyle;
    }

    public Double getDeposit() {
        return deposit;
    }

    public void setDeposit(Double deposit) {
        this.deposit = deposit;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public String getTypepayment() {
        return typepayment;
    }

    public void setTypepayment(String typepayment) {
        this.typepayment = typepayment;
    }

    public String getLinkmap() {
        return linkmap;
    }

    public void setLinkmap(String linkmap) {
        this.linkmap = linkmap;
    }

    public List<Savemessage> getSavemessageList() {
        return savemessageList;
    }

    public void setSavemessageList(List<Savemessage> savemessageList) {
        this.savemessageList = savemessageList;
    }

    public List<LinkImage> getLinkImageList() {
        return linkImageList;
    }

    public void setLinkImageList(List<LinkImage> linkImageList) {
        this.linkImageList = linkImageList;
    }

    public SwhUser getIDUser() {
        return iDUser;
    }

    public void setIDUser(SwhUser iDUser) {
        this.iDUser = iDUser;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idHouse != null ? idHouse.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof House)) {
            return false;
        }
        House other = (House) object;
        if ((this.idHouse == null && other.idHouse != null) || (this.idHouse != null && !this.idHouse.equals(other.idHouse))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.House[ idHouse=" + idHouse + " ]";
    }

    /**
     * @return the dateExpire
     */
    public Date getDateExpire() {
        return dateExpire;
    }

    /**
     * @param dateExpire the dateExpire to set
     */
    public void setDateExpire(Date dateExpire) {
        this.dateExpire = dateExpire;
    }
    
}
